//配置路由表

import React from "react";
import { AppstoreOutline,CameraOutline,GiftOutline,FileOutline,UserOutline } from 'antd-mobile-icons'
import {Navigate} from 'react-router-dom'
let Home =React.lazy(()=>import('../pages/home/Index'))
let Layout =React.lazy(()=>import('../pages/layout/Index'))
let Trip =React.lazy(()=>import('../pages/trip/Index'))
let Order =React.lazy(()=>import('../pages/order/Index'))
let My =React.lazy(()=>import('../pages/my/Index'))
let Login =React.lazy(()=>import('../pages/login/Index'))
let City =React.lazy(()=>import('../pages/city/Index'))
let List =React.lazy(()=>import('../pages/list/Index'))
let Detail =React.lazy(()=>import('../pages/detail/Index'))
let Shop =React.lazy(()=>import('../pages/shop/Index'))

export const otherRoutes=[
    {
         path:'/',
         element:<Home/>,
         title:'首页',
         icon:<AppstoreOutline />
    },
     {
         path:'/trip',
         element:<Trip/>,
         title:'定制旅行',
         icon:<CameraOutline />
    },
     {
         path:'/shop',
         element:<Shop/>,
         title:'里程商店',
         icon:<GiftOutline />
    },
     {
         path:'/order',
         element:<Order/>,
         title:'订单',
         icon:<FileOutline />
    },
     {
         path:'/my',
         element:<My/>,
         title:'我的',
         icon:<UserOutline />
    }
]

const routes =[ 
    {
        path:'/',
        element:<Layout/>,
        children:[
            ...otherRoutes,
            {
                path:'/',
                element:<Navigate to="/"></Navigate>
            }
        ]
    },
    {
        path:'/login',
         element:<Login/>
    },
    {
        path:'/city',
         element:<City/>
    },
    {
        path:'/detail',
         element:<Detail/>
    },
    {
        path:'/list',
         element:<List/>
    }
]

export default routes